package tazadum.razzmatazz.scene;

import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;

import tazadum.engine.Engine;
import tazadum.engine.event.SyncEventQueue;
import tazadum.engine.math.Vector;
import tazadum.engine.scene.Scene;

public class SolidBackgroundScene implements Scene {
	private final Vector backgroundColor;

	public SolidBackgroundScene(final Vector backgroundColor) {
		this.backgroundColor = backgroundColor;
	}

	@Override
	public void loadResources(final Engine engine, final SyncEventQueue queue) {
	}

	@Override
	public void init(final Engine engine, final GLAutoDrawable drawable, final SyncEventQueue queue) {
	}

	@Override
	public void display(final GLAutoDrawable drawable, final SyncEventQueue queue, final float time) {
		final GL gl = drawable.getGL();

		gl.glClearColor(backgroundColor.x, backgroundColor.y, backgroundColor.z, 1.0f);
		gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
	}
}
